<?php
/**
 * Created by PhpStorm.
 * User: Dark
 * Date: 2015/8/2
 * Time: 10:46
 */

namespace Home\Model;
use Think\Model\ViewModel;


class GoodsDetailInfoViewModel extends ViewModel {
    /*
     *定义视图
     */
    public $viewFields = array(
        'goods'=>array('ID','brandType_ID','goodsType_ID','goodsName','unitPrice','otherSpecifications','imageURLs','clickNumber','collectNumber','purchaseNumber','shelveNumber','currentNumber','_as'=>'a'),
        'goods_type'=>array('goodsTypeName','_as'=>'b','_on'=>'a.goodsType_ID=b.ID'),
        'brand_type'=>array('brandTypeName','_as'=>'c','_on'=>'a.brandType_ID=c.ID')
    );

    /*
     * 获取所有的商品信息
     */
    public function queryAll() {
        return $this->select();
    }
}